#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#define MAX 10000
typedef long long ll;
using namespace std;
ll a[MAX];
int main() {
    int n, m;
    cin>>n>>m;
    for (int i=0; i<n; i++) scanf("%lld", &a[i]);
    sort(a,a+n);
    int cnt=0;
    int l=0, r=n-1;
    while (l<r) {
        if (a[l] + a[r] <= m) {
            cnt++;
            l++;
            r--;
            if (l==r) cnt++;
        }
        else {
            r--;
            cnt++;
            if (r==l) cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}
